package com.eds.ru2000.controller;

import java.util.Map;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.util.sm3.Sm3Util;

@RestController
@RequestMapping("/ru2000")
public class RU2000AlgorithmController {
	
	/**
	 * SM3加密
	 * @param param
	 * @return
	 */
	@PostMapping("/encryptSM3")
    public String encryptSM3(@RequestBody Map<String, String> param)
    {
		String data = param.get("data");
		String privateKey = param.get("privateKey");
        return Sm3Util.encrypt(data, privateKey);
    }
	

}
